import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2025-07-03
 * Time: 16:33
 */
public class Test17 {
    public static int firstMissingPositive(int[] num) {
        int n = num.length;
        int[] hash = new int[n+1];
        for(int i = 0; i < n;i++) {
            if(num[i] >= 1 && num[i] <= n) {
                hash[num[i]-1]++;
            }
        }

        for(int i = 0; i < n+1; i++) {
            if(hash[i] == 0) {
                return i+1;
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        for(int i = 0; i < n; i++) {
            num[i] = sc.nextInt();
        }
        int ret = firstMissingPositive(num);
        System.out.println("缺失的第一个正数："+ret);
    }
}
